Java For Beginners Guide To Learn Java And Java Programming (Java Programming Books) by Josh Thompsons
Author:Josh Thompsons [Thompsons, Josh]
Language: eng
Format: epub
Published: 2017-03-15T07:00:00+00:00
Chapter Summary:
In this chapter, we have covered the following concepts:
The IF statement structure and use
How to use Conditional Operators
How to construct and use the IF … ELSE statement
How to construct and use the IF … ELSE IF statement
How to construct and use Nested IF statements
What Boolean values are and how to use them
How to construct and use a switch statement
Chapter 3: Statements – Looping and Iteration
As I said to you earlier, your programming is sequential, meaning it flows from the top down, each line of code executed unless Java is told otherwise. In the last chapter, we looked at how to use the IF statement to tell Java that you don’t want every line executed. But there is another way of interrupting the flow and that is to use loops. Loops force a program to go back to the beginning, or to a specified place, allowing you to execute code repeatedly. Let’s look at an example; let’s say that you wanted to add the numbers from 10 through to 20. It is quite easy to do that in Java:
As an example, suppose you wanted to add up the numbers 1 to 10. You could do it quite easily in Java like this:
int addition = 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20;
That method is fine for just a few numbers but what if you wanted to add all the numbers from 1 to 500 or 1000? We would use a loop on a line of code repeatedly until we got to 500 or 1000 then we would exit the loop and carry on.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Deep Learning with Python by François Chollet(12569)
Hello! Python by Anthony Briggs(9914)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9795)
The Mikado Method by Ola Ellnestam Daniel Brolund(9777)
Dependency Injection in .NET by Mark Seemann(9337)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8296)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7763)
Grails in Action by Glen Smith Peter Ledbrook(7696)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7557)
Becoming a Dynamics 365 Finance and Supply Chain Solution Architect by Brent Dawson(7062)
Microservices with Go by Alexander Shuiskov(6824)
Practical Design Patterns for Java Developers by Miroslav Wengner(6741)
Test Automation Engineering Handbook by Manikandan Sambamurthy(6684)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6413)
Angular Projects - Third Edition by Aristeidis Bampakos(6088)
The Art of Crafting User Stories by The Art of Crafting User Stories(5615)
NetSuite for Consultants - Second Edition by Peter Ries(5554)
Demystifying Cryptography with OpenSSL 3.0 by Alexei Khlebnikov(5356)
Kotlin in Action by Dmitry Jemerov(5062)
